
    
        
FOR EACH sct_det WHERE sct_site BEGINS "510" AND sct_sim = "Standard" AND sct_cst_tot >= 0 NO-LOCK,
    EACH pt_mstr WHERE pt_part = sct_part AND SUBSTR (pt_part_type,2,2) <> '51' 
                   AND pt_part_type <> "P000" AND SUBSTR (pt_part_type,4,1) <> '1' AND pt_part_type <> 'P500' NO-LOCK :

    DISPLAY sct_part sct_site sct_sim pt_part_type pt_pm_code pt_status sct_cst_tot pt_desc1 WITH STREAM-IO WIDTH 200.
END.




PROCEDURE DeleteSct.

  DEFINE INPUT PARAMETER part     LIKE sct_part   NO-UNDO.
  DEFINE INPUT PARAMETER site     LIKE sct_site   NO-UNDO.
  DEFINE INPUT PARAMETER sim      LIKE sct_sim    NO-UNDO.

  
  FOR EACH sct_det WHERE sct_site = site AND sct_sim = sim AND sct_part = part EXCLUSIVE-LOCK:


    FOR EACH spt_det WHERE spt_part = sct_part AND spt_sim = sct_sim AND spt_site = sct_site EXCLUSIVE-LOCK:
        DELETE spt_det.
    END.

    DELETE sct_det.

  END.

END.
